class HomeBean{
  int alarmAmount;
  List<AlarmModule> moduleList;

  HomeBean(int alarmAmount, Map tempList){
    this.alarmAmount = alarmAmount;
    List<AlarmModule> list = new List();
    for(String key in tempList.keys){
      list.add(AlarmModule(key, tempList[key]));
    }
    this.moduleList = list;
  }

  @override
  String toString() {
    return 'HomeBean{alarmAmount: $alarmAmount, moduleList: $moduleList}';
  }
}

class AlarmModule{
  String moduleType ;
  List<AlarmInfo> tempList;

  AlarmModule(String moduleType, List tempList){
    this.moduleType = moduleType;
    List<AlarmInfo> list = new List();
    for(Map data in tempList){
      list.add(AlarmInfo.fromJson(data));
    }
    this.tempList = list;
  }

  @override
  String toString() {
    return 'AlarmModule{moduleType: $moduleType, tempList: $tempList}';
  }
}

class AlarmInfo{
  int alarmType;
  String alarmTypeName;
  int amount;
  int type;

  AlarmInfo({this.alarmType, this.alarmTypeName, this.amount, this.type});

  AlarmInfo.fromJson(Map<String, dynamic> json) {
    alarmType = json['alarmType'];
    alarmTypeName = json['alarmTypeName'];
    amount = json['amount'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['alarmType'] = this.alarmType;
    data['alarmTypeName'] = this.alarmTypeName;
    data['amount'] = this.amount;
    data['type'] = this.type;
    return data;
  }

  @override
  String toString() {
    return 'AlarmInfo{alarmType: $alarmType, alarmTypeName: $alarmTypeName, amount: $amount, type: $type}';
  }
}
